package ProjectYudisium;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class PengendaliYudisium extends JFrame {

    Container contentPane;
    private JLabel labeljdl1, labeljdl2, jdl, labellogin, labeldev;
    private JRadioButton sekre, mhs;
    private JButton login, dev;

    public PengendaliYudisium() {
        setSize(580,380);
        setLocation(375, 100);
        setTitle("FRAME MENU UTAMA YUDISIUM");
        setResizable(true);
        setCursor(Cursor.HAND_CURSOR);
        setDefaultCloseOperation(EXIT_ON_CLOSE);

        contentPane = getContentPane();
        contentPane.setLayout(null);
        contentPane.setBackground(Color.lightGray);
        
        JLabel logo = new JLabel(new ImageIcon("Pictures/usd.gif"));
        logo.setBounds(20, 15, 150, 120);
        add(logo);

        labeljdl1 = new JLabel();
        Font font = new Font("Charlemagne Std", 1, 22);
        labeljdl1.setText("UNIVERSITAS SANATA DHARMA");
        labeljdl1.setBounds(165, 40, 600, 50);
        labeljdl1.setFont(font);
        add(labeljdl1);

        labeljdl2 = new JLabel();
        labeljdl2.setText("YOGYAKARTA");
        labeljdl2.setBounds(280, 75, 600, 50);
        labeljdl2.setFont(font);
        add(labeljdl2);

        jdl = new JLabel("SISTEM YUDISIUM");
        jdl.setFont(new Font("Algerian", 1, 55));
        jdl.setBounds(40,30, 600, 300);
        add(jdl);

        labellogin = new JLabel("LOGIN as : ");
        labellogin.setFont(new Font("Harrington", 2, 24));
        labellogin.setBounds(80,83, 200, 300);
        add(labellogin);

        //Membuat Radio Button
        final ButtonGroup BG = new ButtonGroup();
        font = new Font("Times New Roman", 5, 16);
        sekre = new JRadioButton("SEKRETARIAT");
        sekre.setBounds(200, 220, 130, 30);
        sekre.setFont(font);
        mhs = new JRadioButton("MAHASISWA");
        mhs.setBounds(200, 250, 130, 30);
        mhs.setFont(font);
        sekre.setBackground(Color.lightGray);
        mhs.setBackground(Color.lightGray);

        //Mengaktifkan Pilihan Radio Button dan Menambahkan Obyeknya ke ButtonGroup
        sekre.setEnabled(true);
        mhs.setEnabled(true);
        BG.add(sekre);
        BG.add(mhs);
        add(sekre);
        add(mhs);

        login = new JButton("LOGIN");
        font = new Font("Times New Roman", 1, 18);
        login.setFont(font);
        login.setBackground(Color.yellow);
        login.setBounds(345, 235, 100, 35);
        add(login);
        login.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
                if (sekre.isSelected()) {
                    JOptionPane.showMessageDialog(null, "Your Choice is LOGIN as SEKRETARIAT");
                    FrameUtamaSekretariat frameSekre = new FrameUtamaSekretariat();
                    frameSekre.setVisible(true);
                    dispose();
                } else if (mhs.isSelected()) {
                    JOptionPane.showMessageDialog(null, "Your Choice is LOGIN as MAHASISWA");
                    FrameUtamaMahasiswa frameMHS = new FrameUtamaMahasiswa();
                    frameMHS.setVisible(true);
                    dispose();
                } else {
                    JOptionPane.showMessageDialog(null, "Please Select Your Choice to LOGIN", "DANGER", DEFAULT_CURSOR);
                }
            }
        });

        dev = new JButton("View Developer");
        dev.setFont(font);
        dev.setBackground(Color.cyan);
        dev.setBounds(20,290,180,35);
        add(dev);
        dev.addActionListener(new ActionListener() {//
            @Override
            public void actionPerformed(ActionEvent e) {
                final JDialog dev = new JDialog();
                dev.setSize(600,600);
                dev.setLocation(360,40);
                dev.setLayout(null);
                dev.setVisible(true);
                dev.setBackground(Color.lightGray);
                dispose();
                JLabel jdl = new JLabel("DATA DEVELOPER SISTEM YUDISIUM - KELOMPOK 3");
                jdl.setFont(new Font("Harrington", 1,20));
                jdl.setBounds(25,10,600,40);
                dev.add(jdl);
                Font font = new Font("Times New Roman",1,13);
                JTextArea dev1 = new JTextArea(3, 1);
                dev1.setText("1. Nama  : CAROLUS BENNY DWI SETIAWAN"
                        +"\n    NIM   : 115314018"+"\n    Contact Person  : 081 911 487 165");
                dev1.setEditable(false);
                dev1.setFont(font);
                dev1.setBackground(Color.lightGray);
                dev1.setBounds(20,210,270,65);
                dev.add(dev1);
                JLabel pic1 = new JLabel(new ImageIcon("Pictures/benny.JPG"));
                pic1.setBounds(30,50,250,160);
                dev.add(pic1);
                
                JTextArea dev2 = new JTextArea(3, 1);
                dev2.setText("2. Nama  : RICHARDUS TUNGKY SATRIA"
                        +"\n    NIM   : 115314006"+"\n    Contact Person  : 085 643 599 359");
                dev2.setEditable(false);
                dev2.setFont(font);
                dev2.setBackground(Color.lightGray);
                dev2.setBounds(320,210,250,65);
                dev.add(dev2);
                JLabel pic2 = new JLabel(new ImageIcon("Pictures/tungky.JPG"));
                pic2.setBounds(310,50,250,160);
                dev.add(pic2);
               
                JTextArea dev3 = new JTextArea(3, 1);
                dev3.setText("3. Nama  : MARIA RENIA OCTAVIANI"
                        +"\n    NIM   : 115314010"+"\n    Contact Person  : 085 741 223 358");
                dev3.setEditable(false);
                dev3.setFont(font);
                dev3.setBackground(Color.lightGray);
                dev3.setBounds(20,450,270,65);
                dev.add(dev3);
                JLabel pic3 = new JLabel(new ImageIcon("Pictures/renia.JPG"));
                pic3.setBounds(30,290,250,160);
                dev.add(pic3);
                
                JTextArea dev4 = new JTextArea(3, 1);
                dev4.setText("4. Nama  : KEVIN ADITYA PRASETYO"
                        +"\n    NIM   : 115314041"+"\n    Contact Person  : 085 747 316 892");
                dev4.setEditable(false);
                dev4.setFont(font);
                dev4.setBackground(Color.lightGray);
                dev4.setBounds(320,450,250,65);
                dev.add(dev4);
                JLabel pic4 = new JLabel(new ImageIcon("Pictures/kevin.JPG"));
                pic4.setBounds(310,290,250,160);
                dev.add(pic4);
                
                JButton back = new JButton("BACK TO HOME");
                back.setBounds(180,520,250,30);
                back.setFont(font);
                back.setBackground(Color.cyan);
                back.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        setVisible(true);
                        dev.dispose();
                    }
                });
                dev.add(back);
                
            }
        });
    }
}
